Since a tape streamer drive that records and reproduces digital data to/from a magnetic tape has a huge storage capacity, it has been widely used so as to back up data stored in a storing device such as a hard disk or the like. In addition, the tape streamer drive is suitable for recording a large file that contains moving picture data.
In such a tape streamer drive, digital data is recorded/reproduced to/from a magnetic tape in helical scan method with a rotating head using a tape cassette similar to an 8-mm type tape cassette.
To increase data record capacity, a tape streamer driver that compresses and records data with LZ (Lempel-ZIV) code has been proposed.
When data is compressed and recorded, the record capacity of data increases. In particular, when sequential data is recorded/reproduced, since the data amount to be read/written decreases, the access speed apparently increases.
To accomplish such a data compressing function, the tape streamer drive is provided with a data compressing/expanding portion that compresses/expands data of for example LZ code. Normally, the data compressing/expanding portion has an original data side interface, a compressing/expanding engine, and a compression data side interface. Each of the original data side interface and the compression data side interface has an FIFO (First-In-First-Out) register that adjusts the DMA (Direct Memory Access) transmission speed.
When such a tape streamer drive records data, it receives the data from a host computer through the original data side interface. The data is sent as records (composed of 512 bytes each). The data is supplied to the data compressing/expanding engine. The data compressing/expanding engine successively compresses the data. The compressed data is recorded as groups (composed of several tracks each) on the magnetic tape.
As shown in FIG. 1A, data records SD.sub.1, SD.sub.2, SD.sub.3, and so forth are input to the original data side interface. The data records SD.sub.1, SD.sub.2, SD.sub.3, and so forth are supplied to the data compressing/expanding engine. As shown in FIG. 1B, the data compressing/expanding engine compresses the data records SD.sub.1, SD.sub.2, SD.sub.3, and so forth into compressed data records sd.sub.1, sd.sub.2, sd.sub.3, and so forth. A buffer memory is disposed just after the data compressing/expanding portion. The compressed data records sd.sub.1, sd.sub.2, sd.sub.3, and so forth are temporarily stored in the buffer memory. When the data amount of the compressed data records sd.sub.1, sd.sub.2, sd.sub.3, and so forth becomes the amount of data for one group, as shown in FIG. 1C, the data is recorded to a group that is composed of a predetermined of tracks.
In the data reproduce mode, data is reproduced as groups from the magnetic tape. The reproduced data is temporarily stored in the buffer memory. When the data amount stored in the buffer memory becomes the data amount for one group, the data is supplied to the data compressing/expanding portion. The data compressing/expanding portion expands the reproduced data to original data. For example, data is supplied as records (composed of 512 bytes each) to the host computer.
As described above, in the tape streamer drive of which data is compressed and then recorded on a magnetic tape, data that has been input as records from the host computer is compressed and then stored in the buffer memory. Since the data that has been compressed is variable length data and the compression rate of data varies depending on the type thereof, it is difficult to predict the amount of data that has been compressed. Thus, the buffer memory may overflow.
In other words, in the record mode, the host computer designates the record length and the number of records of data to be sent to the tape streamer drive. Since the amount of data compressed cannot be predicted, when the data with the designated record length is compressed for the number of records being designated and stored in the buffer memory, the buffer memory may overflow. When the buffer memory overflows, a control for temporarily suspending the transmission of data from the host computer is required.
In the tape streamer drive that compresses data and records the compressed data to the magnetic tape, in the reproduce mode, the tape streamer drive reproduces data as groups from the magnetic tape and stores the reproduced data in the buffer memory. When data of a predetermined unit (for example composed of a plurality of records) continues to the next group, the data of the next group should be read.
In other words, as shown in FIGS. 2A and 2B, when data elements (of a predetermined unit) sd.sub.11, sd.sub.12, sd.sub.13, and so forth are recorded, a data element sd.sub.m at the last of a group GP1 may continue to the group GP1 (see FIG. 2A) or be completed in the next group GP2 (see FIG. 2B). In the case that the data sd.sub.m at the last of the group GP1 is completed in the group GP1, by accessing the group GP1, the data of the group GP1 can be completely reproduced. On the other hand, as shown in FIG. 2A, when the data sd.sub.m at the last of the group GP1 continues to the group GP2, to reproduce the data s.sub.m, the next group GP2 should be also accessed.
Thus, in the data recording/reproducing apparatus that compresses data and records the compressed data to the magnetic tape, the data transmission of the host computer should be controlled so that the buffer does not overflow. In the reproduce mode, data accessing process should be controlled depending on whether or not data of a predetermined unit is completed in one group.